<template>
  <div class="main">
    <nav-bar/>
    <swipper :banners="banners"/>
    <!--显示房间数据-->
    <room :notice="notice"/>
    <el-backtop target=".main"></el-backtop>
    <Footer/>
  </div>
</template>

<script>
import NavBar from "@/components/common/navbar/NavBar";
import Swipper from "@/components/common/swipper/Swipper";
import Room from "@/components/conment/rooms/Room";
import Scroll from "@/components/common/scroll/Scroll";
import {getCommonShow} from "@/network/common";
import Footer from "@/components/common/footer/Footer";
export default {
  name: "index",
  components: {Footer, Scroll, Room, Swipper, NavBar},
  data(){
    return{
      banners:[],
      notice:[],
    }
  },
  created() {
    //获取轮播 和提示
    getCommonShow().then(res=>{
      let r = res.data.data
      r.forEach(s=>{
        if (s.type==='banner'){
          this.banners.push(s)
        }else if(s.type==='notice'){
          this.notice.push(s)
        }
      })
    })
  },
}
</script>

<style scoped>
  .main {
    height: 100vh;
    overflow-x: hidden;
  }
</style>